<#-- 导入模版定义文件-->
<#include "../template/template_editPage.ftl">
<@edit title="操作员管理">
    <#if (operator.operatorId)??>
        <#assign isEdit = true />
    <#else>
        <#assign isAdd = true />
    </#if>
<body class="input">

<script type="text/javascript">


    $().ready(function () {

        var $validateErrorContainer = $("#validateErrorContainer");
        var $validateErrorLabelContainer = $("#validateErrorContainer ul");
        var $validateForm = $("#inputForm");
        var $tab = $("#tab");

        // Tab效果
        $tab.tabs(".tabContent", {
            tabs:"input"
        });

        // 表单验证
        $validateForm.validate({
            errorContainer:$validateErrorContainer,
            errorLabelContainer:$validateErrorLabelContainer,
            wrapper:"li",
            errorClass:"validateError",
            ignoreTitle:true,
            rules:{
                "operator.operatorName":{
                    required:true
                },
                "operator.operatorPassword":{
                    required:true
                },
                "operatorPasswordRe":{
                    required:true
                },
                "operator.email":{
                    required:true
                }
            },
            messages:{
                "operator.operatorName":{
                    required:"操作员名不能为空！"
                },
                "operator.operatorPassword":{
                    required:"密码不能为空！"
                },
                "operatorPasswordRe":{
                    required:"重复密码不能为空！"
                },
                "operator.email":{
                    required:"邮箱不能为空！"
                }
            },
            submitHandler:function (form) {
                //$(form).find(":submit").attr("disabled", true);
                form.submit();
            }
        });
        <#if actionErrors?? && (actionErrors?size > 0)>
            $.messager.show("提示信息", "<#list errorMessages as list>${list}<br></#list>", 2000);
        </#if>
    });
</script>

<div class="body">
<div class="inputBar">
    <h1><span class="icon">&nbsp;</span><#if isAdd??>添加操作员信息<#else>编辑操作员信息</#if></h1>
</div>
<div style="display: none;" id="validateErrorContainer" class="validateErrorContainer">
    <div class="validateErrorTitle">以下信息填写有误,请重新填写</div>
    <ul></ul>
</div>
<form id="inputForm" class="validate"
      action="<#if isAdd??>${web_base}/ekhui/operator!addComplete.htm<#else>${web_base}/ekhui/operator!edit.htm</#if>"
      method="post">
	    <#if isAdd??>
	    	<input type="hidden" name="trader.traderId" value="${trader.traderId!''}"/>
	    <#else>
	    	<input type="hidden" name="operator.operatorId" value="${operator.operatorId!''}"/>
	    	 
	    </#if>
    <table class="inputTable tabContent">

        <tr>
            <th>
                操作员名称：
            </th>
            <td>
                <#if isAdd??>
                    <input type="text"  id="operatorName" name="operator.operatorName" class="formText {required: true}"
                           />
                    <label class="requireField">*</label>
                <#else>
                    <input type="text" id="operatorName" name="operator.operatorName" class="formText {required: true}" readonly
                           value="${(operator.operatorName)!}"/>
                </#if>
            </td>
        </tr>
        <#if isAdd??>
         <tr>
            <th>
                登陆密码：
            </th>
            <td>

                
                    <input type="text" id="operatorPassword" type="password" name="operator.operatorPassword" class="formText {required: true}"
                           value="" />
                
                <label class="requireField">*</label>
                <span id="priceSpan2" style="color: red;"></span>
            </td>
        </tr>
        </#if>
         <#if isAdd??>
                <tr>
            <th>
                重复登陆密码：
            </th>
            <td>
                    <input type="text" id="goodsMoney" type="password" id="operatorPasswordRe" name="operatorPasswordRe" class="formText {required: true}"
                           value="" />
                <label class="requireField">*</label>
                <span id="priceSpan2" style="color: red;"></span>
            </td>
        </tr>
        </#if>
        <tr>
            <th>
               qq：
            </th>
            <td>
                <#if isAdd??>
                    <input type="text" id="qq" name="operator.qq" class="formText {required: false}"
                           value="" />
                <#else>
                    <input type="text" id="qq" name="operator.qq" class="formText {required: false}"
                           value="${operator.qq!''}" />
                </#if>
            </td>
        </tr>

        <tr>
            <th>
                邮箱：
            </th>
            <td>

                <#if isAdd??>
                    <input type="text" id="email" name="operator.email" class="formText {required: true}"
                           value="" onblur="checkParvalue()"/>
                <#else>

                    <input type="text" id="email" name="operator.email" class="formText {required: true}"
                           value="${operator.email!''}" onblur="checkParvalue()"/>
                </#if>
                <label class="requireField">*</label>
                <span id="priceSpan2" style="color: red;"></span>
            </td>
        </tr>
    </table>
    <div class="buttonArea">
        <input type="submit" class="formButton" <#if isAdd??> value="添  加" <#else> value="更  新"</#if>hidefocus="true" />&nbsp;&nbsp;&nbsp;&nbsp;
        <input type="button" class="formButton" onclick="window.history.back(); return false;" value="返  回"
               hidefocus="true"/>
    </div>
</form>
</div>
</body>
</@edit>
